package level4.net.third_party_api.renrenapi
{
	import com.adobe.crypto.MD5;

	/**
	 * 人人平台,相册签名结构
	 * */
	public class RRSignatureStruct
	{
		/**版本,默认1.0*/
		public var verson:String = "1.0";
		/**api key*/
		public var apiKey:String;
		/**准备调用的方法*/
		public var method:String;
		/**请求队列号,随机数即可*/
		public var callId:String = "123456789987654321";
		/**回话id*/
		public var sessionKey:String;
		/**密钥*/
		public var secretKey:String;
		/**相册id*/
		public var albumId:uint;
		/**标题*/
		public var caption:String;
		/**url*/
		public var url:String;
		
		public function RRSignatureStruct()
		{
		}
		/**
		 * 获取md5消化过的字符串.
		 * */
		public function getMD5Hash():String{
			var arr:Array = [
				"aid=",albumId,
				"api_key=",apiKey,
				"call_id=",callId,
				"caption=",caption,
				"format=",RRResponseFormat.RESP_JSON,
				"method=",method,
				"session_key=",sessionKey,
				"v=",verson,
				secretKey
			];
			return MD5.hash(arr.join(""));
		}
		
	}
}